package so.wy.servicecenter.businessbed.service.order.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import so.wy.servicecenter.businessbed.dao.rdb.order.order_price.OrderPriceDO;

import java.math.BigDecimal;

/**
* @author wdl
* @date 2020-04-08
*/
@Data
@NoArgsConstructor
public class OrderPriceDTO{

	/** 主键ID */
	private Long id;
	/** 医院ID */
	private String orderSerial;
	/** 1周期 2起始+后续 */
	private Integer priceType;
	/** 起始小时数 */
	private Integer priceStartHour;
	/** 起始价格 */
	private BigDecimal priceStartMoney;
	/** 后续每小时价格 */
	private BigDecimal priceAfterMoney;
	/** 排序 */
	private Integer sortNum;

	public OrderPriceDTO(OrderPriceDO orderPriceDO){
		if(orderPriceDO==null){
			return ;
		}

		this.id = orderPriceDO.getId();
		this.orderSerial = orderPriceDO.getOrderSerial();
		this.priceType = orderPriceDO.getPriceType();
		this.priceStartHour = orderPriceDO.getPriceStartHour();
		this.priceStartMoney = orderPriceDO.getPriceStartMoney();
		this.priceAfterMoney = orderPriceDO.getPriceAfterMoney();
		this.sortNum = orderPriceDO.getSortNum();
	}

	public OrderPriceDO convert2DO(){
		OrderPriceDO orderPriceDO = new OrderPriceDO();
		orderPriceDO.setId(this.id);
		orderPriceDO.setOrderSerial(this.orderSerial);
		orderPriceDO.setPriceType(this.priceType);
		orderPriceDO.setPriceStartHour(this.priceStartHour);
		orderPriceDO.setPriceStartMoney(this.priceStartMoney);
		orderPriceDO.setPriceAfterMoney(this.priceAfterMoney);
		orderPriceDO.setSortNum(this.sortNum);
		return orderPriceDO;
	}

}
